Repository navigation
fix(db): type the integer columns of applications, node relations and page contents - #3203
Open
rubenvdlinde wants to merge 1 commit into
Open
rubenvdlinde wants to merge 1 commit into
rubenvdlinde wants to merge 1 commit into
Conversation
3 of 5 tasks
rubenvdlinde
force-pushed
the
feat/noid/app-menu-export-import
branch
from
November 3, 2026 14:51
a1b94a7 to
2471ff4
Compare
rubenvdlinde
force-pushed
the
fix/noid/entity-addtype-names
branch
from
November 3, 2026 14:51
877a03b to
05b7968
Compare
… page contents `Context`, `ContextNodeRelation` and `PageContent` registered their field types under the column names (`owner_type`, `context_id`, `node_id`, `node_type`, `page_id`, `node_rel_id`), while the entity looks them up by property name. The casts never applied and the mapper bound these columns as strings. They are now registered by property name. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
rubenvdlinde
force-pushed
the
feat/noid/app-menu-export-import
branch
from
November 4, 2026 12:35
2471ff4 to
6368c26
Compare
rubenvdlinde
force-pushed
the
fix/noid/entity-addtype-names
branch
from
November 4, 2026 12:36
05b7968 to
2f29f7a
Compare
rubenvdlinde
marked this pull request as ready for review
November 6, 2026 08:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sits on #3138 (menu export and import), though the bug is older and on
maintoo.Context,ContextNodeRelationandPageContentnow register their field types under the property names, so the integer types they declare actually apply.Size: 119 lines: 12 code and 107 tests.
What was wrong
Entity::addType()takes a property name:Entity::setter()andQBMapper::getParameterTypeForProperty()both look the type up by property. These three entities registered theirs under the column names (owner_type,context_id,node_id,node_type,page_id,node_rel_id), so:getFieldTypes()listed six names that are not properties, and no type forownerType,contextId,nodeId,nodeType,pageIdandnodeRelIdValues read back from the database were already integers, because the properties are typed
?intand PHP converts a numeric string on assignment. A non-numeric value would still throw aTypeErrorthere instead of being cast.What changes
The six
addType()calls use the property names.Contexthad the same pattern forowner_type, so it's included.How it was tested
On Nextcloud 34 with PostgreSQL, new
tests/unit/Db/EntityFieldTypesTest.php:integerIQueryBuilder::PARAM_INTWithout the change, the first two fail for all three entities (6 of 7 tests). The full unit suite passes on PostgreSQL (620 tests).
composer cs:check, psalm and rector are all clean.🖼️ Screenshots
No UI changes.
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)